<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.example</groupId>
    <artifactId>java-examples</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>pom</packaging>
    <modules>
        <module>fixture-eventer</module>
        <module>scheme-generator</module>
        <module>utilites</module>
        <module>perfomancer</module>
        <module>properties-manager</module>
        <module>exceptions</module>
        <module>plantuml-painter</module>
        <module>mockito-examples</module>
        <module>junit5-examples</module>
        <module>allure-examples</module>
        <module>example-module</module>
    </modules>

    <!-- region properties -->
    <properties>
        <!-- Кодировка -->
        <encoding.type>UTF-8</encoding.type>
        <project.build.sourceEncoding>${encoding.type}</project.build.sourceEncoding>
        <project.reporting.outputEncoding>${encoding.type}</project.reporting.outputEncoding>
        <maven.compiler.encoding>${encoding.type}</maven.compiler.encoding>

        <!-- Версия Java -->
        <java.version>11</java.version>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>

        <!-- Версия плагинов Maven -->
        <exec.maven.plugin.version>3.1.0</exec.maven.plugin.version>
        <maven.compiler.plugin.version>3.10.1</maven.compiler.plugin.version>
        <maven.surefire.plugin.version>3.1.2</maven.surefire.plugin.version>

        <!-- Подключаемые зависимости -->
        <junit5.version>5.9.2</junit5.version>
        <aspectj.version>1.9.7</aspectj.version>
        <logback.version>1.2.7</logback.version>
        <slf4j.api.version>1.7.32</slf4j.api.version>
        <lombok.version>1.18.18</lombok.version>
        <mockito-junit-jupiter>5.2.0</mockito-junit-jupiter>
        <jackson.dataformat.xml.version>2.16.0</jackson.dataformat.xml.version>

        <!-- Allure-->
        <allure.junit5.version>2.22.0</allure.junit5.version>
        <allure.report.version>2.20.1</allure.report.version>
        <allure.maven.version>2.12.0</allure.maven.version>
        <allure.results.directory>target/allure-results</allure.results.directory>
    </properties>
    <!-- endregion properties -->

    <!-- region dependencies -->
    <dependencies>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>${lombok.version}</version>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j.api.version}</version>
        </dependency>

        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-core</artifactId>
            <version>${logback.version}</version>
        </dependency>

        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>${logback.version}</version>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-junit-jupiter</artifactId>
            <version>${mockito-junit-jupiter}</version>
        </dependency>
    </dependencies>
    <!-- endregion dependencies -->

    <!-- region dependencyManagement -->
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.junit</groupId>
                <artifactId>junit-bom</artifactId>
                <version>${junit5.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>io.qameta.allure</groupId>
                <artifactId>allure-bom</artifactId>
                <version>${allure.junit5.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>com.fasterxml.jackson.dataformat</groupId>
                <artifactId>jackson-dataformat-xml</artifactId>
                <version>${jackson.dataformat.xml.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <!-- endregion dependencyManagement -->

    <!-- region build -->
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven.compiler.plugin.version}</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <encoding>${maven.compiler.encoding}</encoding>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven.surefire.plugin.version}</version>
                <configuration>
                    <argLine>
                        -javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
                    </argLine>
                    <useSystemClassLoader>true</useSystemClassLoader>
                    <systemProperties>
                        <property>
                            <name>allure.results.directory</name>
                            <value>${allure.results.directory}</value>
                        </property>
                    </systemProperties>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.aspectj</groupId>
                        <artifactId>aspectjweaver</artifactId>
                        <version>${aspectj.version}</version>
                    </dependency>
                </dependencies>
            </plugin>

            <plugin>
                <groupId>io.qameta.allure</groupId>
                <artifactId>allure-maven</artifactId>
                <version>${allure.maven.version}</version>
                <configuration>
                    <reportVersion>${allure.report.version}</reportVersion>
                    <resultsDirectory>${project.build.directory}/allure-results</resultsDirectory>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <!-- endregion build -->

</project>